/**
*      author: Y_Yao
*      created: 2025-02-21 21:45:49
**/

#include<bits/stdc++.h>

#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 1e18;
const int INF = 0x3f3f3f3f;
int cnt,sum;

void solve()
{
    cin >> cnt >> sum;

    int tmp = sum / 1000 - cnt;
    
    int max_a = min(cnt,tmp / 9);
    for(int a = max_a; a >= 0;a--)
    {
        int b = tmp - 9 * a;
        if(b % 4 != 0) continue;
        b = b / 4;
        int c = cnt - a - b;
        if(c >= 0 && b >= 0)
        {
            cout << a << " " << b << " " << c << endl;
            return;
        }
    }
    cout << -1 << " " << -1 << " " << -1 << endl;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}